home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / RLaB / help / COMPLEX < prev    next >
Text File  |  1994-04-25  |  888b  |  43 lines

  1. COMPLEX:
  2.  
  3.     RLaB supports COMPLEX data types. The "type" of a variable is
  4.     revealed by typing:
  5.  
  6.         var.type
  7.  
  8.         or
  9.  
  10.         show(var)
  11.  
  12.     In the 1st instance the return value is a string, in the 2nd
  13.     instance, the return value is a string matrix.
  14.  
  15.     Complex variables can be used via the MATLAB syntax:
  16.  
  17.     i = sqrt(-1)
  18.  
  19.     z = 1 + 2*i
  20.  
  21.     z = a + b*i
  22.  
  23.     or with RLaB's complex constant feature:
  24.  
  25.     z = 1 + 2i
  26.  
  27.     z = 1 + 2j    // equivalent to the previous statement
  28.  
  29.     The complex constants `i' and `j' do not interfere with
  30.     ordinary variables `i' and `j' since the complex constants
  31.     must immediately follow a number to be interpreted as a
  32.     complex constant. 
  33.  
  34.     For example:
  35.  
  36.     1i    // valid complex constant
  37.  
  38.     1 i    // two separate statements
  39.  
  40.     Wherever it makes sense, built-in functions will accept real,
  41.     and complex arguments. For example, inv(), det(), eig(), fft()
  42.     will accept both real and complex inputs.
  43.